import Util;
import RPC;
import EndpointUtil;

extends RPC;

init(config: RPC.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('edasmsc', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

model GetServiceMethodPageRequest = {
  region?: string(name='Region'),
  serviceType?: string(name='ServiceType'),
  appId?: string(name='AppId'),
  serviceName?: string(name='ServiceName'),
  serviceVersion?: string(name='ServiceVersion'),
  serviceGroup?: string(name='ServiceGroup'),
  ip?: string(name='Ip'),
  pageNumber?: integer(name='PageNumber'),
  pageSize?: integer(name='PageSize'),
  methodController?: string(name='MethodController'),
  path?: string(name='Path'),
  name?: string(name='Name'),
}

model GetServiceMethodPageResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  message: string(name='Message'),
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  data: {
    pageNumber: integer(name='PageNumber'),
    totalSize: integer(name='TotalSize'),
    pageSize: integer(name='PageSize'),
    result: [
      {
        name: string(name='Name'),
        returnType: string(name='ReturnType'),
        nameDetail: string(name='NameDetail'),
        returnDetails: string(name='ReturnDetails'),
        methodController: string(name='MethodController'),
        parameterDefinitions: [
          {
            name: string(name='Name'),
            description: string(name='Description'),
            type: string(name='Type'),
          }
        ](name='ParameterDefinitions'),
        parameterTypes: [ string ](name='ParameterTypes'),
        requestMethods: [ string ](name='RequestMethods'),
        paths: [ string ](name='Paths'),
        parameterDetails: [ string ](name='ParameterDetails'),
      }
    ](name='Result'),
  }(name='Data'),
}

async function getServiceMethodPageWithOptions(request: GetServiceMethodPageRequest, runtime: Util.RuntimeOptions): GetServiceMethodPageResponse {
  Util.validateModel(request);
  return doRequest('GetServiceMethodPage', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function getServiceMethodPage(request: GetServiceMethodPageRequest): GetServiceMethodPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return getServiceMethodPageWithOptions(request, runtime);
}

model ListAuthPolicyRequest = {
  region: string(name='Region'),
  pageNumber: string(name='PageNumber'),
  pageSize: string(name='PageSize'),
  source: string(name='Source'),
  protocol?: string(name='Protocol'),
  name?: string(name='Name'),
  appId?: string(name='AppId'),
}

model ListAuthPolicyResponse = {
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  data: {
    pageNumber: integer(name='PageNumber'),
    pageSize: integer(name='PageSize'),
    totalSize: integer(name='TotalSize'),
    result: [
      {
        accountId: string(name='AccountId'),
        appId: string(name='AppId'),
        appName: string(name='AppName'),
        enable: boolean(name='Enable'),
        id: integer(name='Id'),
        name: string(name='Name'),
        namespaceId: string(name='NamespaceId'),
        protocol: string(name='Protocol'),
        regionId: string(name='RegionId'),
        source: string(name='Source'),
        status: integer(name='Status'),
        authRule: [
          {
            black: boolean(name='Black'),
            path: string(name='Path'),
            method: {
              serviceName: string(name='ServiceName'),
              version: string(name='Version'),
              group: string(name='Group'),
              name: string(name='Name'),
              returnType: string(name='ReturnType'),
              parameterTypes: [ string ](name='ParameterTypes'),
            }(name='Method'),
            appIds: [ string ](name='AppIds'),
          }
        ](name='AuthRule'),
      }
    ](name='Result'),
  }(name='Data'),
}

async function listAuthPolicyWithOptions(request: ListAuthPolicyRequest, runtime: Util.RuntimeOptions): ListAuthPolicyResponse {
  Util.validateModel(request);
  return doRequest('ListAuthPolicy', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function listAuthPolicy(request: ListAuthPolicyRequest): ListAuthPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAuthPolicyWithOptions(request, runtime);
}

model GetApplicationListRequest = {
  region: string(name='Region'),
  appName?: string(name='AppName'),
  appId?: string(name='AppId'),
  source?: string(name='Source'),
  language?: string(name='Language'),
  pageNumber: integer(name='PageNumber'),
  pageSize: integer(name='PageSize'),
}

model GetApplicationListResponse = {
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  data: {
    pageNumber: integer(name='PageNumber'),
    pageSize: integer(name='PageSize'),
    totalSize: integer(name='TotalSize'),
    result: [
      {
        appId: string(name='AppId'),
        appName: string(name='AppName'),
        licenseKey: string(name='LicenseKey'),
        source: string(name='Source'),
        regionId: string(name='RegionId'),
        status: string(name='Status'),
        userId: string(name='UserId'),
        extraInfo: string(name='ExtraInfo'),
        instancesNumber: integer(name='InstancesNumber'),
      }
    ](name='Result'),
  }(name='Data'),
}

async function getApplicationListWithOptions(request: GetApplicationListRequest, runtime: Util.RuntimeOptions): GetApplicationListResponse {
  Util.validateModel(request);
  return doRequest('GetApplicationList', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function getApplicationList(request: GetApplicationListRequest): GetApplicationListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getApplicationListWithOptions(request, runtime);
}

model GetOutlierPolicyInfoRequest = {
  policyId: string(name='PolicyId'),
}

model GetOutlierPolicyInfoResponse = {
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  result: [
    {
      errorRateThreshold: float(name='ErrorRateThreshold'),
      isOutlierEnabled: boolean(name='IsOutlierEnabled'),
      isolationTime: integer(name='IsolationTime'),
      maxIsolationTimeMultiple: integer(name='MaxIsolationTimeMultiple'),
      outlierEnabled: boolean(name='OutlierEnabled'),
      policyId: integer(name='PolicyId'),
      policyName: string(name='PolicyName'),
      requestThreshold: integer(name='RequestThreshold'),
      rpcType: integer(name='RpcType'),
      shouldCountBizError: boolean(name='ShouldCountBizError'),
    }
  ](name='Result'),
}

async function getOutlierPolicyInfoWithOptions(request: GetOutlierPolicyInfoRequest, runtime: Util.RuntimeOptions): GetOutlierPolicyInfoResponse {
  Util.validateModel(request);
  return doRequest('GetOutlierPolicyInfo', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function getOutlierPolicyInfo(request: GetOutlierPolicyInfoRequest): GetOutlierPolicyInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOutlierPolicyInfoWithOptions(request, runtime);
}

model ListOutlierPolicyRequest = {
  policyName?: string(name='PolicyName'),
  region: string(name='Region'),
  source: string(name='Source'),
  appName?: string(name='AppName'),
  pageNumber: string(name='PageNumber'),
  pageSize: string(name='PageSize'),
  rpcType?: string(name='RpcType'),
}

model ListOutlierPolicyResponse = {
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  data: {
    pageSize: integer(name='PageSize'),
    totalSize: integer(name='TotalSize'),
    pageNumber: integer(name='PageNumber'),
    result: [
      {
        errorRateThreshold: float(name='ErrorRateThreshold'),
        id: integer(name='Id'),
        isOutlierEnabled: boolean(name='IsOutlierEnabled'),
        isolationTime: integer(name='IsolationTime'),
        maxIsolationRate: float(name='MaxIsolationRate'),
        maxIsolationTimeMultiple: integer(name='MaxIsolationTimeMultiple'),
        namespaceId: string(name='NamespaceId'),
        policyId: integer(name='PolicyId'),
        policyName: string(name='PolicyName'),
        regionId: string(name='RegionId'),
        requestThreshold: integer(name='RequestThreshold'),
        rpcType: integer(name='RpcType'),
        shouldCountBizError: boolean(name='ShouldCountBizError'),
        userId: string(name='UserId'),
        appList: [
          {
            appId: string(name='AppId'),
            appName: string(name='AppName'),
            dockerize: boolean(name='Dockerize'),
          }
        ](name='AppList'),
      }
    ](name='Result'),
  }(name='Data'),
}

async function listOutlierPolicyWithOptions(request: ListOutlierPolicyRequest, runtime: Util.RuntimeOptions): ListOutlierPolicyResponse {
  Util.validateModel(request);
  return doRequest('ListOutlierPolicy', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function listOutlierPolicy(request: ListOutlierPolicyRequest): ListOutlierPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOutlierPolicyWithOptions(request, runtime);
}

model GetAuthPolicyInfoRequest = {
  policyId: string(name='PolicyId'),
}

model GetAuthPolicyInfoResponse = {
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  data: {
    accountId: string(name='AccountId'),
    appId: string(name='AppId'),
    enable: boolean(name='Enable'),
    id: integer(name='Id'),
    name: string(name='Name'),
    namespaceId: string(name='NamespaceId'),
    protocol: string(name='Protocol'),
    regionId: string(name='RegionId'),
    source: string(name='Source'),
    status: integer(name='Status'),
    appName: string(name='AppName'),
    authRule: [
      {
        black: boolean(name='Black'),
        path: string(name='Path'),
        all: boolean(name='All'),
        method: {
          serviceName: string(name='ServiceName'),
          version: string(name='Version'),
          group: string(name='Group'),
          name: string(name='Name'),
          returnType: string(name='ReturnType'),
          parameterTypes: [ string ](name='ParameterTypes'),
        }(name='Method'),
        appIds: [ string ](name='AppIds'),
        appNames: [ string ](name='AppNames'),
      }
    ](name='AuthRule'),
  }(name='Data'),
}

async function getAuthPolicyInfoWithOptions(request: GetAuthPolicyInfoRequest, runtime: Util.RuntimeOptions): GetAuthPolicyInfoResponse {
  Util.validateModel(request);
  return doRequest('GetAuthPolicyInfo', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function getAuthPolicyInfo(request: GetAuthPolicyInfoRequest): GetAuthPolicyInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAuthPolicyInfoWithOptions(request, runtime);
}

model RemoveOutlierPolicyRequest = {
  policyId: string(name='PolicyId'),
}

model RemoveOutlierPolicyResponse = {
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  result: string(name='Result'),
  success: boolean(name='Success'),
}

async function removeOutlierPolicyWithOptions(request: RemoveOutlierPolicyRequest, runtime: Util.RuntimeOptions): RemoveOutlierPolicyResponse {
  Util.validateModel(request);
  return doRequest('RemoveOutlierPolicy', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function removeOutlierPolicy(request: RemoveOutlierPolicyRequest): RemoveOutlierPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeOutlierPolicyWithOptions(request, runtime);
}

model CreateApplicationRequest = {
  appName: string(name='AppName'),
  region: string(name='Region'),
  source?: string(name='Source'),
  language?: string(name='Language'),
  extraInfo?: string(name='ExtraInfo'),
}

model CreateApplicationResponse = {
  requestId: string(name='RequestId'),
  success: string(name='Success'),
  message: string(name='Message'),
  code: string(name='Code'),
  data: {
    appName: string(name='AppName'),
    licenseKey: string(name='LicenseKey'),
    appId: string(name='AppId'),
    userId: string(name='UserId'),
    regionId: string(name='RegionId'),
    source: string(name='Source'),
    language: string(name='Language'),
    createTime: long(name='CreateTime'),
    updateTime: long(name='UpdateTime'),
    status: integer(name='Status'),
    extraInfo: string(name='ExtraInfo'),
  }(name='Data'),
}

async function createApplicationWithOptions(request: CreateApplicationRequest, runtime: Util.RuntimeOptions): CreateApplicationResponse {
  Util.validateModel(request);
  return doRequest('CreateApplication', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function createApplication(request: CreateApplicationRequest): CreateApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApplicationWithOptions(request, runtime);
}

model CheckAuthPolicyNameRequest = {
  region: string(name='Region'),
  policyName: string(name='PolicyName'),
  source: string(name='Source'),
}

model CheckAuthPolicyNameResponse = {
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  data: boolean(name='Data'),
  success: boolean(name='Success'),
}

async function checkAuthPolicyNameWithOptions(request: CheckAuthPolicyNameRequest, runtime: Util.RuntimeOptions): CheckAuthPolicyNameResponse {
  Util.validateModel(request);
  return doRequest('CheckAuthPolicyName', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function checkAuthPolicyName(request: CheckAuthPolicyNameRequest): CheckAuthPolicyNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkAuthPolicyNameWithOptions(request, runtime);
}

model RemoveAuthPolicyRequest = {
  policyId: string(name='PolicyId'),
}

model RemoveAuthPolicyResponse = {
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  data: string(name='Data'),
}

async function removeAuthPolicyWithOptions(request: RemoveAuthPolicyRequest, runtime: Util.RuntimeOptions): RemoveAuthPolicyResponse {
  Util.validateModel(request);
  return doRequest('RemoveAuthPolicy', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function removeAuthPolicy(request: RemoveAuthPolicyRequest): RemoveAuthPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeAuthPolicyWithOptions(request, runtime);
}

model RemoveApplicationRequest = {
  appId: string(name='AppId'),
  region: string(name='Region'),
}

model RemoveApplicationResponse = {
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  data: string(name='Data'),
}

async function removeApplicationWithOptions(request: RemoveApplicationRequest, runtime: Util.RuntimeOptions): RemoveApplicationResponse {
  Util.validateModel(request);
  return doRequest('RemoveApplication', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function removeApplication(request: RemoveApplicationRequest): RemoveApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeApplicationWithOptions(request, runtime);
}

model UpdateOutlierConfigRequest = {
  policyId: string(name='PolicyId'),
  appList?: string(name='AppList'),
  outlierConfig?: string(name='OutlierConfig'),
}

model UpdateOutlierConfigResponse = {
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  result: string(name='Result'),
  success: boolean(name='Success'),
}

async function updateOutlierConfigWithOptions(request: UpdateOutlierConfigRequest, runtime: Util.RuntimeOptions): UpdateOutlierConfigResponse {
  Util.validateModel(request);
  return doRequest('UpdateOutlierConfig', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function updateOutlierConfig(request: UpdateOutlierConfigRequest): UpdateOutlierConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateOutlierConfigWithOptions(request, runtime);
}

model CreateOutlierConfigRequest = {
  policyName: string(name='PolicyName'),
  policyDescription?: string(name='PolicyDescription'),
  region: string(name='Region'),
  appList: string(name='AppList'),
  outlierConfig: string(name='OutlierConfig'),
  source: string(name='Source'),
}

model CreateOutlierConfigResponse = {
  requestId: string(name='RequestId'),
  success: string(name='Success'),
  message: string(name='Message'),
  code: string(name='Code'),
  data: string(name='Data'),
}

async function createOutlierConfigWithOptions(request: CreateOutlierConfigRequest, runtime: Util.RuntimeOptions): CreateOutlierConfigResponse {
  Util.validateModel(request);
  return doRequest('CreateOutlierConfig', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function createOutlierConfig(request: CreateOutlierConfigRequest): CreateOutlierConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return createOutlierConfigWithOptions(request, runtime);
}

model UpdateAuthPolicyRequest = {
  name?: string(name='Name'),
  source?: string(name='Source'),
  id: string(name='Id'),
  region?: string(name='Region'),
  enable?: string(name='Enable'),
  appId?: string(name='AppId'),
  protocol?: string(name='Protocol'),
  authRule?: string(name='AuthRule'),
}

model UpdateAuthPolicyResponse = {
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  data: string(name='Data'),
  success: boolean(name='Success'),
}

async function updateAuthPolicyWithOptions(request: UpdateAuthPolicyRequest, runtime: Util.RuntimeOptions): UpdateAuthPolicyResponse {
  Util.validateModel(request);
  return doRequest('UpdateAuthPolicy', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function updateAuthPolicy(request: UpdateAuthPolicyRequest): UpdateAuthPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAuthPolicyWithOptions(request, runtime);
}

model GetOutlierApplicationListRequest = {
  region: string(name='Region'),
  source: string(name='Source'),
  rpcType: string(name='RpcType'),
}

model GetOutlierApplicationListResponse = {
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  data: [
    {
      adminEdasId: string(name='AdminEdasId'),
      appId: string(name='AppId'),
      appName: string(name='AppName'),
      description: string(name='Description'),
      dockerize: boolean(name='Dockerize'),
      owner: string(name='Owner'),
      regionId: string(name='RegionId'),
    }
  ](name='Data'),
}

async function getOutlierApplicationListWithOptions(request: GetOutlierApplicationListRequest, runtime: Util.RuntimeOptions): GetOutlierApplicationListResponse {
  Util.validateModel(request);
  return doRequest('GetOutlierApplicationList', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function getOutlierApplicationList(request: GetOutlierApplicationListRequest): GetOutlierApplicationListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOutlierApplicationListWithOptions(request, runtime);
}

model AddAuthPolicyRequest = {
  name: string(name='Name'),
  source: string(name='Source'),
  region: string(name='Region'),
  enable: string(name='Enable'),
  appId: string(name='AppId'),
  protocol: string(name='Protocol'),
  authRule: string(name='AuthRule'),
  namespaceId?: string(name='NamespaceId'),
}

model AddAuthPolicyResponse = {
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  message: string(name='Message'),
  requestId: string(name='RequestId'),
  data: string(name='Data'),
  success: boolean(name='Success'),
}

async function addAuthPolicyWithOptions(request: AddAuthPolicyRequest, runtime: Util.RuntimeOptions): AddAuthPolicyResponse {
  Util.validateModel(request);
  return doRequest('AddAuthPolicy', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function addAuthPolicy(request: AddAuthPolicyRequest): AddAuthPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return addAuthPolicyWithOptions(request, runtime);
}

model GetServiceListPageRequest = {
  region?: string(name='Region'),
  serviceType?: string(name='ServiceType'),
  side?: string(name='Side'),
  pageNumber?: integer(name='PageNumber'),
  pageSize?: integer(name='PageSize'),
  appId?: string(name='AppId'),
  serviceName?: string(name='ServiceName'),
  ip?: string(name='Ip'),
}

model GetServiceListPageResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  message: string(name='Message'),
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  data: {
    pageNumber: string(name='PageNumber'),
    totalSize: string(name='TotalSize'),
    pageSize: string(name='PageSize'),
    currentPage: string(name='CurrentPage'),
    result: [
      {
        serviceName: string(name='ServiceName'),
        version: string(name='Version'),
        group: string(name='Group'),
        edasAppId: string(name='EdasAppId'),
        edasAppName: string(name='EdasAppName'),
        instanceNum: integer(name='InstanceNum'),
        gmtModifyTime: string(name='GmtModifyTime'),
      }
    ](name='Result'),
  }(name='Data'),
}

async function getServiceListPageWithOptions(request: GetServiceListPageRequest, runtime: Util.RuntimeOptions): GetServiceListPageResponse {
  Util.validateModel(request);
  return doRequest('GetServiceListPage', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function getServiceListPage(request: GetServiceListPageRequest): GetServiceListPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return getServiceListPageWithOptions(request, runtime);
}

model GetServiceDetailRequest = {
  region?: string(name='Region'),
  serviceType?: string(name='ServiceType'),
  appId?: string(name='AppId'),
  serviceName?: string(name='ServiceName'),
  serviceVersion?: string(name='ServiceVersion'),
  serviceGroup?: string(name='ServiceGroup'),
  ip?: string(name='Ip'),
}

model GetServiceDetailResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  message: string(name='Message'),
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  data: {
    serviceName: string(name='ServiceName'),
    version: string(name='Version'),
    group: string(name='Group'),
    dubboApplicationName: string(name='DubboApplicationName'),
    edasAppName: string(name='EdasAppName'),
    springApplicationName: integer(name='SpringApplicationName'),
    serviceType: string(name='ServiceType'),
    metadata: map[string]any(name='Metadata'),
    methods: [
      {
        name: string(name='Name'),
        returnType: string(name='ReturnType'),
        nameDetail: string(name='NameDetail'),
        returnDetails: string(name='ReturnDetails'),
        methodController: string(name='MethodController'),
        parameterDefinitions: [
          {
            name: string(name='Name'),
            description: string(name='Description'),
            type: string(name='Type'),
          }
        ](name='ParameterDefinitions'),
        parameterTypes: [ string ](name='ParameterTypes'),
        requestMethods: [ string ](name='RequestMethods'),
        paths: [ string ](name='Paths'),
        parameterDetails: [ string ](name='ParameterDetails'),
      }
    ](name='Methods'),
  }(name='Data'),
}

async function getServiceDetailWithOptions(request: GetServiceDetailRequest, runtime: Util.RuntimeOptions): GetServiceDetailResponse {
  Util.validateModel(request);
  return doRequest('GetServiceDetail', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function getServiceDetail(request: GetServiceDetailRequest): GetServiceDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getServiceDetailWithOptions(request, runtime);
}

model GetServiceConsumersPageRequest = {
  region?: string(name='Region'),
  serviceType?: string(name='ServiceType'),
  pageNumber?: integer(name='PageNumber'),
  pageSize?: integer(name='PageSize'),
  appId?: string(name='AppId'),
  serviceName?: string(name='ServiceName'),
  serviceVersion?: string(name='ServiceVersion'),
  serviceGroup?: string(name='ServiceGroup'),
  ip?: string(name='Ip'),
}

model GetServiceConsumersPageResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  message: string(name='Message'),
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  data: {
    totalSize: integer(name='TotalSize'),
    pageSize: integer(name='PageSize'),
    pageNumber: integer(name='PageNumber'),
    currentPage: integer(name='CurrentPage'),
    result: [
      {
        ip: string(name='Ip'),
        edasAppName: string(name='EdasAppName'),
        edasAppId: string(name='EdasAppId'),
      }
    ](name='Result'),
  }(name='Data'),
}

async function getServiceConsumersPageWithOptions(request: GetServiceConsumersPageRequest, runtime: Util.RuntimeOptions): GetServiceConsumersPageResponse {
  Util.validateModel(request);
  return doRequest('GetServiceConsumersPage', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function getServiceConsumersPage(request: GetServiceConsumersPageRequest): GetServiceConsumersPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return getServiceConsumersPageWithOptions(request, runtime);
}

model GetServiceProvidersPageRequest = {
  region?: string(name='Region'),
  serviceType?: string(name='ServiceType'),
  pageNumber?: integer(name='PageNumber'),
  pageSize?: integer(name='PageSize'),
  appId?: string(name='AppId'),
  serviceName?: string(name='ServiceName'),
  serviceVersion?: string(name='ServiceVersion'),
  serviceGroup?: string(name='ServiceGroup'),
  ip?: string(name='Ip'),
}

model GetServiceProvidersPageResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  message: string(name='Message'),
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  data: {
    pageNumber: integer(name='PageNumber'),
    totalSize: integer(name='TotalSize'),
    pageSize: integer(name='PageSize'),
    currentPage: integer(name='CurrentPage'),
    result: [
      {
        ip: string(name='Ip'),
        port: string(name='Port'),
        serializeType: string(name='SerializeType'),
        timeout: string(name='Timeout'),
      }
    ](name='Result'),
  }(name='Data'),
}

async function getServiceProvidersPageWithOptions(request: GetServiceProvidersPageRequest, runtime: Util.RuntimeOptions): GetServiceProvidersPageResponse {
  Util.validateModel(request);
  return doRequest('GetServiceProvidersPage', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function getServiceProvidersPage(request: GetServiceProvidersPageRequest): GetServiceProvidersPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return getServiceProvidersPageWithOptions(request, runtime);
}

model GetServiceListRequest = {
  region?: string(name='Region'),
  serviceType?: string(name='ServiceType'),
  appId?: string(name='AppId'),
  serviceName?: string(name='ServiceName'),
  ip?: string(name='Ip'),
}

model GetServiceListResponse = {
  requestId: string(name='RequestId'),
  success: boolean(name='Success'),
  message: string(name='Message'),
  code: string(name='Code'),
  httpCode: string(name='HttpCode'),
  data: [
    {
      serviceName: string(name='ServiceName'),
      version: string(name='Version'),
      group: string(name='Group'),
      dubboApplicationName: string(name='DubboApplicationName'),
      edasAppName: string(name='EdasAppName'),
      springApplicationName: integer(name='SpringApplicationName'),
      serviceType: string(name='ServiceType'),
      registryType: string(name='RegistryType'),
      metadata: map[string]any(name='Metadata'),
      methods: [
        {
          name: string(name='Name'),
          returnType: string(name='ReturnType'),
          parameterTypes: [ string ](name='ParameterTypes'),
        }
      ](name='Methods'),
    }
  ](name='Data'),
}

async function getServiceListWithOptions(request: GetServiceListRequest, runtime: Util.RuntimeOptions): GetServiceListResponse {
  Util.validateModel(request);
  return doRequest('GetServiceList', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function getServiceList(request: GetServiceListRequest): GetServiceListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getServiceListWithOptions(request, runtime);
}

model QueryLocationsRequest = {
}

model QueryLocationsResponse = {
  requestId: string(name='RequestId'),
  success: string(name='Success'),
  message: string(name='Message'),
  code: string(name='Code'),
  data: [
    {
      type: string(name='Type'),
      name: string(name='Name'),
      cnName: string(name='CnName'),
      enName: string(name='EnName'),
      showName: string(name='ShowName'),
      description: string(name='Description'),
      enDescription: string(name='EnDescription'),
      ordering: integer(name='Ordering'),
      districtId: string(name='DistrictId'),
      districtCnName: string(name='DistrictCnName'),
      districtEnName: string(name='DistrictEnName'),
      districtShowName: string(name='DistrictShowName'),
      districtOrdering: integer(name='DistrictOrdering'),
    }
  ](name='Data'),
}

async function queryLocationsWithOptions(request: QueryLocationsRequest, runtime: Util.RuntimeOptions): QueryLocationsResponse {
  Util.validateModel(request);
  return doRequest('QueryLocations', 'HTTPS', 'POST', '2020-03-23', 'AK', null, request, runtime);
}

async function queryLocations(request: QueryLocationsRequest): QueryLocationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryLocationsWithOptions(request, runtime);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }

  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
